package study.sharding.shardingjdbc.support.key;

import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.spi.keygen.ShardingKeyGenerator;

import java.util.Properties;

@Slf4j
public class CustomKeyGenerator implements ShardingKeyGenerator {

    private static final String TYPE = "Custom";

    @Override
    public Comparable<?> generateKey() {
        log.info("ssssssssss");
        return 1111L;
    }

    @Override
    public String getType() {
        return TYPE;
    }

    @Override
    public void setProperties(Properties props) {
        props.forEach((k, v) -> {
            log.info("{}= {}", k, v);
        });
    }

    @Override
    public Properties getProperties() {
        return null;
    }
}
